<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/5/4
  Time: 17:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.project.DB_Airline" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%
    // 获取表单数据
    String aid = request.getParameter("aid");
    String fid = request.getParameter("fid");
    String dateYear = request.getParameter("dateYear");
    String dateMonth = request.getParameter("dateMonth");
    String dateDay = request.getParameter("dateDay");
    String position = request.getParameter("position");
    String remain = request.getParameter("remain");

    // 构建更新操作的输入列表
    List<String> updateInput = new ArrayList<>();
    updateInput.add(aid);
    updateInput.add(fid);
    updateInput.add(dateYear);
    updateInput.add(dateMonth);
    updateInput.add(dateDay);
    updateInput.add(position);
    updateInput.add(remain);

    // 创建DB_Airline实例
    DB_Airline dbAirline = new DB_Airline();
    // 执行更新操作
    boolean updateResult = dbAirline.update(updateInput);

    if (updateResult) {
        // 更新成功，重定向到index.jsp
        response.sendRedirect("index.jsp");
    } else {
        // 更新失败，输出错误信息
        out.println("更新航空公司失败");
    }
%>